package org.pcorp.battlespace.modele.type;


public class TypeVaissStruct implements IntTypeVaissStruct {
	
	private String js;

	public TypeVaissStruct() {
		js = "var varCoefStruct=1000; var varCoefPass=0.025;";
	}
	
	public TypeVaissStruct(double coefInt, double coefPas) {
		js = "var varCoefStruct="+ coefInt + "; var varCoefPass="+coefPas+"";
	}

	public void setCoef(double coefInt, double coefPas) {
		js = "var varCoefStruct="+ coefInt + "; var varCoefPass="+coefPas+"";
	}
	
	public String getJS() {
		return js;
}

	public double getMasseStructure(long integrite, long masse) {
		// TODO Auto-generated method stub
		return 0;
	}

	public void setJS(String js) {
		this.js = js;
	}

	public long getIntegriteMin(long masse) {
		return 1;
	}

	public long getBlindageMax(double masse) {
		return Math.round(masse*4);
	}

	public double getCoefBlindage(double masse) {
		if (masse<12500)
			return 1.6;
		if (masse<20000)
			return 1.4;
		if (masse<50000)
			return 1.2;
		if (masse<65000)
			return 1;
		
		return 0.8;
	}

	public long getSabordMax(double masse) {
		if (masse<250)
			return 3;
		if (masse<10000)
			return 4;
		if (masse<20000)
			return 6;
		
		return Math.round(masse/3000);
	}



	

}
